package com.wang.config;

import com.wang.view.JsonViewResolver;
import com.wang.view.HtmlViewResolver;
import com.wang.view.PdfViewResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @Classname WebMvcConfig
 * @Description TODO
 * @Date 2024/5/17 12:19
 * @Created by pc
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
    @Override
    protected void configureViewResolvers(ViewResolverRegistry registry) {
        registry.enableContentNegotiation(new PdfViewResolver());
        registry.enableContentNegotiation(new HtmlViewResolver());
        registry.enableContentNegotiation(new JsonViewResolver());
        registry.enableContentNegotiation(false);
    }
}
